using System;
using System.Xml.Serialization;

namespace Communication
{
    /// <summary>
    /// Represents a PhonebookEntry extended by the storage value.
    /// </summary>
    [Serializable]
    public class PhonebookEntryWithStorage : PhonebookEntry
    {
        private string _storage;

        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public PhonebookEntryWithStorage()
        {
        }

        /// <summary>
        /// Initializes a new instance of the class using the specified values.
        /// </summary>
        /// <param name="entry">The phonebook entry</param>
        /// <param name="storage">The storage the entry was read from.</param>
        public PhonebookEntryWithStorage(PhonebookEntry entry, string storage) : base(entry)
        {
            _storage = storage;
        }

        /// <summary>
        /// The storage the entry was read from.
        /// </summary>
        [XmlAttribute]
        public string Storage
        {
            get { return _storage; }
            set { _storage = value; }
        }
    }
}